package cn.seecoder.ai.exception;


import cn.seecoder.ai.enums.ErrorCodeEnum;
import cn.seecoder.ai.enums.TrainingStateEnum;
import lombok.Data;

/**
 * 内部错误，不需要抛出到前端
 * @author   fanyanpeng
 * @date 2023/4/8 3:09
 */
@Data
public class AIInternalException extends RuntimeException{
    private String message;
    private ErrorCodeEnum errorCodeEnum;
    public AIInternalException(String message){
        this.message=message;
    }
    public AIInternalException(ErrorCodeEnum errorCodeEnum){
        this.errorCodeEnum=errorCodeEnum;
    }

    public static AIInternalException modelNotDeployable(Integer modelId, TrainingStateEnum trainingState) {
        return new AIInternalException("模型不能部署，模型-"+modelId+" 的状态为："+trainingState);
    }
}
